package org.leumasjaffe.math.probability;

import java.util.Random;

import org.eclipse.jdt.annotation.NonNull;

public class DynBernoulliRV extends BernoulliRV implements DynamicRV {

	public DynBernoulliRV() {
		super(0);
	}
	
	public DynBernoulliRV(@NonNull Random r) {
		super(r, 0);
	}
	
	private void set(double b) {
		this.p = b;
	}

	@Override
	public double getX(double b) {
		set(b);
		return getX();
	}

	@Override
	public double getEV(double b) {
		set(b);
		return getEV();
	}

	@Override
	public double getVar(double b) {
		set(b);
		return getVar();
	}

	@Override
	public double getP(double x, double b) {
		set(b);
		return getP(x);
	}

	@Override
	public double calcX(double p, double b) {
		set(b);
		return calcX(p);
	}

	@Override
	public double getF(double x, double b) {
		set(b);
		return getF(x);
	}

}
